﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DevExpress.XtraEditors.DXErrorProvider;

namespace Submitter
{
    class TextLengthValidationRule : ValidationRule
    {
        public int Length { get; set; }

        public override bool Validate(System.Windows.Forms.Control control, object value)
        {

            var str = (string)value;
            if (string.IsNullOrEmpty(str))
            {
                return false;
            }


            return str.Length == Length;
        }
    }
}
